<template>
	<view class="content">
		<view class="info-list" v-for="item in list" :key="item.id"
			@click="navigate('/page_other/company/company?id='+item.id)">
			<view class="info-item">
				<image :src="item.logoUrl ? item.logoUrl : cloudStorage+'/job_hunting/index/enterprise-icon.png'"
					class="special-img"></image>
				<view class="name-item">
					<view class="name">{{item.enterpriseName}}</view>
					<view class="address-item">
						<view class="iconfont icon-a-dizhi1"></view>
						<view class="address">{{item.enterpriseAddress||'暂无'}}</view>
					</view>
				</view>
			</view>
			<view class="post-item" v-for="item1 in item.jobPublishList.slice(0, 3)" :key="item1.id">
				<view class="post-info">
					<view class="title">{{item1.jobName}}</view>
					<view class="experience">{{item1.expRequireText}} · </view>
					<view class="experience">{{item1.minEducationText}}</view>
				</view>
				<view class="wages">{{item1.minSalary}}-{{item1.maxSalary}}</view>
			</view>
			<view class="more-item">
				<view class="recruiting">{{item.jobCount}}个在招职位</view>
				<view class="more">更多职位</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getSpecialRecruitmentById
	} from '@/api/job_hunting.js';
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			getInfo() {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				getSpecialRecruitmentById({
					id: this.id
				}).then((res) => {
					this.list = res.enterpriseModelList ?? [];
				})
			},
		},
		onLoad(e) {
			this.id = e.id
			this.getInfo()
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-image: $custom-background-gradient;
	}

	.content {
		padding: 30rpx;

		.info-list {
			padding: 30rpx;
			background: #FFFFFF;
			margin-bottom: 20rpx;
			border-radius: 30rpx;

			.info-item {
				width: 100%;
				display: flex;
				align-items: center;

				.special-img {
					width: 180rpx;
					height: 180rpx;
					border-radius: 20rpx;
					margin-right: 20rpx;
				}

				.name-item {
					width: calc(100% - 200rpx);

					.name {
						font-size: 32rpx;
						font-weight: bold;
					}

					.address-item {
						display: flex;
						align-items: center;
						margin-top: 30rpx;

						.iconfont {
							color: #0256FF;
							font-size: 32rpx;
							margin-right: 10rpx;
						}

						.address {
							color: #767676;
							font-size: 28rpx;
						}
					}
				}
			}

			.post-item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: 30rpx;

				.post-info {
					display: flex;
					align-items: center;

					.title {
						font-size: 32rpx;
						margin-right: 10rpx;
					}

					.experience {
						color: #767676;
						font-size: 28rpx;
						margin-right: 4rpx;
					}
				}

				.wages {
					color: #027BFF;
					font-size: 30rpx;
				}
			}

			.more-item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				color: #767676;
				font-size: 28rpx;
				margin-top: 30rpx;
			}
		}
	}
</style>